package com.kgc.pay.utils;
import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016110200787721";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDqpTaJyjEIUuJzfaQmoNqtHhGi68MPJmB4D0bjrwzPbSxAPaSWp+MIG8O1GA9LrbAmd7aEKw1UUO13x5PEaEfJWEifcPg5cOf89nY2SpoYymlQBr2ZDNu0tRhSD7/ZyKNR8US8J1Xpg4yUNG5iM06cYyC7i/mP+puQIRTga/NTUWyF9j3wKyPEsGUI5LHdnFtiff3UEtZ7CpeckOdCL0p48q4VJ3HDrw2KF9O26vnjz3+rLwUGfg+/R2qcmSN6JjCNK1xPUYiEa1nOnBUYdxQrOBRo+v3sycztuHRCBE69lfuDfTAYMB8SxpVLLkaHLQcxJokFd+tYCxWrXp8kOZApAgMBAAECggEAEqoTnYA8yDm3k5Ix5XS0EEMtCfWQ7XqS/9nPPLsm3LUFaRK+LdGq6HE07wm75bwqH9Uz6m12QPey++0fHudglm50UGJvDDqj6WY9XvIuMbygBeKTYEI6k7Q3/AcOrqcb/p+fZQwH9GwnWX6WLS+BmET2TJTExCQeDafj/jn3/+96HtZn34SzU3gKhi8NN9cV/kbOOUVz3j99wPo0/4rIBAEWSoROmXMLO46r7VnOTXCUdLgHGMV/1vaX/Kx1ZamXb6DUOpDqpISxL6YQ/OsWhlqhYzY4FMpKeeh8Pe5vv3iNd/vxnWJtu70jJAgCMJ3R2roN1iNlJrYIKEQ4KcmudQKBgQD7EDVaZb5r0DJItffWlh8UD6LU2hguOE6ugUIzrOSwghu7v57bRACtgfg+BuIQ3vpFIV23ZjN3yxMA94+JyasYp/qzeVXuRz4Zm7aOcqDMa1MaKYNOXKplqyba4Nlb1akFm/6hMCvx/WgjtFYz/kT/3iEArj6bWs5oRwaZXxVuOwKBgQDvQlxUcZjTQDL5yjq43B/VklzUaKKmHVheWoLnjT+feY9huwKqJ2cJbMAYUFYgAf2NLCUXLNu6D68WPwSvonxQ8q6HxEv7ZwAV/5D61oxma54UCZD2Ry3T+bHB7Bwu3xJJHbB4vhNxYmz8T6FOXeMkz7YY57zCprMh3IquTvIg6wKBgFHsSwyRUJ6LlCznu9R4rfF03LRJ6kQCuaH1qa2FCCaUfgo4j9SKjxIO6/sJcfEBYXb3WUZEAh1f1XamUV8rwDnObl7sA985vgjLJ7m5q8CocLiDvUXvtOZx/77CSgrOYFXlPiRIvL486yNjcBGNMeSwDeLT+Lfm3J1oN74KKcsLAoGBAJQQQC0t44KQDzvP74kpCDZWDkaQvl8IeABkCPCc08uwIZA8eAiuu6/0cehaBwJl2PA9anKuGwhI3nRo6VB7wG0j0ehJDTB2bHIwpxrkHRzg6oHB7cjLAcxVkLDOmh5Tg/BlhCkkj8myPHnkGZHyvjewpyNAfesD2IVTAyudxW+jAoGAGXoyFK7XLCOoZl4ZbPyENlr0MMxSy8HJT6B+YJcqw/36YaoKZzjIS7sBwBfpwNvPqfsTJ2S+zsYGmmK+jCCT2aLeRUL8/aKr+08DX7vw89bxHVJpNwLBUSlm2kIyhqzm16raxIAQLajRCE5KpvAxT1XwM9loCey1J4nGhCyIkUc=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAknb+rHNqSrbsJ03/W9mrpvgYPRBhAiRx6U3z3t/x/LUVCtDUF3HN2zfRJV1WiHRxppRZ2lALzGN2pccQYl0iKeSMZDBMNTJKdUzeuJlKD8OT9bYVyQaPmszgHmeqfomO0l57NtbjxlfTD3yQ4o6Brp+/mL3yKnCF2w3rk7xMwGBBnRh7m1QMGo79RH8QBPZQZjBOeaHubh10GLHwZI89kfHETniVB5nfRvVYltIshbuHM75dQyZO+GCTHwNBcREv2zVlN8bL9DoPChtPGuJmV0q8Yjhm+7T/xK+n84xh8y1av7t9m3J9d6x4EzKJx5JgIQj+Ow1thtKCq5KGdKn4xQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://kw7dhu.natappfree.cc/pay/notify_url";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://kw7dhu.natappfree.cc/pay/return_url";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "E:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
